﻿<%@ page contentType="text/html; charset=utf-8" language="java" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'charge.jsp' starting page</title>
    <link href="style/stylet.css"
			rel="stylesheet" type="text/css">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<!--
	配置业务费用
	-->

  </head> 
 <script type="text/javascript">
 var xmlhttp;
function showCharge(str)
{
	if (str=="")
  	{
	 	xmlhttp.open("GET","ChargeServlet?selectedValue=A",true);
		xmlhttp.send();
	    document.getElementById("selectvalue").value=xmlhttp.responseText;
  		return;
    }
  if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  		xmlhttp=new XMLHttpRequest();
  }
  else
  {// code for IE6, IE5
  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  	xmlhttp.open("POST","ChargeServlet?selectedValue="+str,true);
  	xmlhttp.onreadystatechange=setvalue;
	
	xmlhttp.send();
}

function setvalue()
  {

  if (xmlhttp.readyState==4)
    {
    var nodes = xmlhttp.responseXML.getElementsByTagName("charge");
    var charge = nodes[0].firstChild.nodeValue;
    document.getElementById("selectvalue").value=charge;
    }
  }
 function checkdata(form){
 	var reg = new RegExp("^[0-9]+(.[0-9]{1,2})?$");
 	if(form.selectvalue.value.length == 0){
 		alert("收费金额不能为空！");
 		form.selectvalue.focus();
 		return false;
 	}
 	if(!reg.test(form.selectvalue.value)){
        alert("请输入数字!如10,102.2,20.99!");
        form.selectvalue.focus();
  		return false;
    }
 	return true;
 }
 
 function checkeddata(form){
 if(!form.checkbox[0].checked&&!form.checkbox[1].checked&&!form.checkbox[2].checked&&!form.checkbox[3].checked&&!form.checkbox[4].checked){
 		alert("请选择收费项目！");
 		return false;
 	}
 	return true;
 }
 </script>
 <body >
    <font size="2"><br>您现在的位置:>>配置业务</font>&nbsp;<div><font color="red" size="2" style="display:none${paly}">${chargeWrong}</font></div><br><hr width="95%" size="2" align="center">
    
    <form action="ChargeServlet" method="post" onsubmit="return checkdata(this)">
      
    <dir style="font-size:18px">收费细项</dir>
    
    收费项目:    
    <select name="selectedValue" id="selectedValue" onchange="showCharge(this.value)">
    
    <option value="A" >开户费</option>
    
    <option value="B">漫游费</option>
    
    <option value="C">押金</option>
    
    <option value="D">入网费</option>
    
    <option value="E">选号费</option>
    
    </select>
    <br> 
    <br>
    
    收费金额: <input type="text" name="selectvalue" id="selectvalue"><br><br>
    <input type="hidden" name="pagename" value="pagecharge">
    <input type="submit" class="tb_top_1"  value="修改收费金额" >
    <input type="reset" class="tb_top_1"  value="全部重写">
    </form>
 <font color="#FF00FF">  </font>
  
    <hr width="100%" size="2">  
    
       
    <form action="ChargeServlet" method="post" onsubmit="return checkeddata(this)">

    <dir style="font-size:18px">业务收费</dir>
    业务:
    <input type="hidden" name="pagename" value="pagechargerule"> 
    <select name="web">
    <option value="O">开户业务</option>
    </select>
    <br><br>
    收费项目:
    
    <input type="checkbox" name="checkbox" value="A" >开户费
    
   
    
    <input type="checkbox" name="checkbox" value="B" >漫游费
    
    
    
    <input type="checkbox" name="checkbox" value="C" >押金
    
    
    <input type="checkbox" name="checkbox" value="D" >入网费
    
    
    
    <input type="checkbox" name="checkbox" value="E">选号费<br>
    <br>
    <input type="submit" class="tb_top_1"  value="提交">
    <input type="reset" class="tb_top_1"  value="全部重写">
  
    </form>
   <font color=""></font>    
      
  </body>
</html>
